﻿using System.Web;
using EPiAbstractions.Common;
using EPiAbstractions.Common.Categories;
using EPiAbstractions.Common.Tags;
using EPiAbstractions.Community;
using EPiAbstractions.Community.Blog;
using EPiAbstractions.Community.Blog.Security;
using EPiAbstractions.Community.ImageGallery;
using EPiAbstractions.Community.MyPage;
using JoelAbrahamsson.BlogExtensions;
using JoelAbrahamsson.MetaWeblog;
using StructureMap;

namespace JoelAbrahamsson.Web
{
    public class MetaWeblogApi : MetaWeblogHandler
    {
        public MetaWeblogApi()
            : base(
                ObjectFactory.GetInstance<BlogHandlerFacade>(),
                ObjectFactory.GetInstance<DefaultSecurityHandlerFacade>(), 
                new SecurityHandlerFacade(), 
                new AuthorHandlerFacade(), 
                new ImageGalleryHandlerFacade(), 
                new BlogCategoryProvider(new CategoryHandlerFacade()),
                new TagHandlerFacade(),
                new BlogTagProvider(),
                new BlogEntryExcerptProvider(),
                new BlogEntrySlugProvider(new HttpContextWrapper(HttpContext.Current)),
                new BlogProvider(new MyPageHandlerFacade())
            )
        {
        }
    }
}
